package com.tz.crm.controller.system;

import com.tz.crm.entity.Department;
import com.tz.crm.service.DepartmentService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * Created by 顾梦莹
 * Date: 2017-3-14.
 * Time: 下午 2:55
 */
@Controller
@RequestMapping("/system")
//@RequestMapping("/user")
public class UserManageController {
    @Resource
    private DepartmentService departmentService;

    @RequestMapping("/search")
    public String initSearch(Model model){
        Department department=departmentService.getRootWithChildren();
        model.addAttribute("department",department.toTagString());
        return "userManage";
    }
}
